import time

t0 = time.time()
count = 0
for i in range(1 , 30):
    for j in range(1, 30):
        for k in range(1, 30):
            for m in range(1, 30):
                for n in range(1, 30):
                    if  i != j and \
                        i != k and \
                        i != m and \
                        i != n and \
                        j != k and \
                        j != m and \
                        j != n and \
                        k != m and \
                        k != n and \
                        m != n and \
                        i + j + k == 59 and \
                        m + n + j == 62:
                            print("   %s   \n" % i)
                            print("%s  %s  %s\n" %(m, j, n))
                            print("   %s   \n" % k)
                            count = count + 1

print(count)

t1 = time.time()

print('used time = %s' % (t1 - t0))


